@extends('layouts.master')

@section('title')
    商品管理——木投网商城管理后台
@stop

@section('app_css')
    <link href="/resource/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="/resource/css/style.css">
    <link rel="stylesheet" href="/resource/css/dataTables.bootstrap.css">
    <link rel="stylesheet" href="/resource/css/fileinput.min.css">
@stop

@section('app_js')
    <script src="/resource/js/jquery-1.11.3.min.js"></script>
    <script src="/resource/js/bootstrap.min.js"></script>
    <script src="/resource/js/jquery.dataTables.min.js"></script>
    <script src="/resource/js/dataTables.bootstrap.min.js"></script>
    <script src="/resource/js/jquery.twbsPagination.js"></script>
    <script src="/resource/js/fileinput.min.js"></script>
    <script src="/resource/js/fileinput_locale_zh.js"></script>
@stop

@section('content')
    @include('common.nav')
    <div class="container-fluid">
        <div class="row" id="navLeft">
            @include('common.product_nav')
            <div class="col-lg-10">
                <div class="navbottom">
                    <span>您的位置：</span>商品 > 商品管理
                </div>
                <div class="contentNav">
                    <ul>
                        <li>商品</li>
                        <li class="btn btn-default"><a href="/show_goods">所有商品</a></li>
                        <li class="btn btn-default active"><a href="/add_goods">商品添加</a></li>
                        <li class="btn btn-default"><a href="">违规下架商品</a></li>
                        <li class="btn btn-default"><a href="">等待审核</a></li>
                        <li class="btn btn-default"><a href="">商品设置</a></li>
                    </ul>
                </div>
                <hr>
                <div class="contentMember_new">
                    {{ Form::open(['url'=>'/edit_goods', 'files' => true, 'method' => 'post']) }}
                    <table class="table table-hover">
                        <tbody>
                        <tr>
                            <th>商品名称：</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th><input type="text" class="input-small form-control" name="product_name" value="{{ $product->product_name }}"></th>
                        </tr>
                        <tr>
                            <th>商品货号：</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th><input type="text"  class="input-small form-control" name="product_sn" value="{{ $product->product_sn }}"></th>
                        </tr>
                        <tr>
                            <th>品牌：</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th>
                                <select class="form-control" name="brand_id">
                                    <option value="0">请选择…</option>
                                    @foreach($brands as $k => $brand)
                                        <option value="{{ $brand->brand_id }} @if($product->brand_id == $brand->brand_id) selected @endif">{{ $brand->brand_name }}</option>
                                    @endforeach
                                </select>
                            </th>
                        </tr>
                        <tr>
                            <th>商品分类：</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th>
                                <select class="form-control" name="cate_id">
                                    <option value="0">请选择…</option>
                                    @foreach($cate as $k => $c)
                                        <option value="{{ $c->cate_id }}" @if($product->cate_id == $c->cate_id) selected @endif>{{ $c->cate_name }}</option>
                                    @endforeach
                                </select>
                            </th>
                        </tr>
                        <tr>
                            <th>供货渠道：</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th>
                                <select class="form-control" name="channel">
                                    @foreach($channel as $k => $v)
                                    <option value="{{ $v }}">{{ $v }}</option>
                                        @endforeach
                                </select>
                            </th>
                        </tr>
                        <tr>
                            <th>库存：</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th><input type="text"  class="input-small form-control" name="stock" value="{{ $product->stock }}"></th>
                        </tr>
                        <tr>
                            <th>本店价格:</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th><input type="text"  class="input-small form-control" name="shop_price" value="{{ $product->shop_price }}"></th>
                        </tr>
                        <tr>
                            <th>商品描述:</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th><input type="text"  class="input-small form-control" name="description" value="{{ $product->description }}"></th>
                        </tr>
                        <tr>
                            <th>供应商:</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th><input type="text"  class="input-small form-control" name="supplier" value="{{ $product->supplier }}"></th>
                        </tr>
                        <tr>
                            <th>产地:</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th><input type="text"  class="input-small form-control" name="place" value="{{ $product->place }}"></th>
                        </tr>
                        <tr>
                            <th>规格:</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th><input type="text"  class="input-small form-control" name="spec" value="{{ $product->spec }}"></th>
                        </tr>
                        <tr>
                            <th>等级:</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th><input type="text"  class="input-small form-control" name="level" value="{{ $product->level }}"></th>
                        </tr>
                        <tr>
                            <th>仓储地:</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th><input type="text"  class="input-small form-control" name="storage" value="{{ $product->storage }}"></th>
                        </tr>
                        <tr>
                            <th>起订量:</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th><input type="text"  class="input-small form-control" name="start_num" value="{{ $product->start_num }}"></th>
                        </tr>
                        <tr>
                            <th>是否自营：</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th>
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="is_self_support" value="1" @if($product->is_self_support == 1) checked @endif>
                                        是
                                    </label>
                                </div>
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="is_self_support" value="0" @if($product->is_self_support == 0) checked @endif>
                                        否
                                    </label>
                                </div>
                            </th>
                        </tr>
                        <tr>
                            <th>是否推荐到首页:</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th>
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="is_index" value="1" @if($product->is_index == 1) checked @endif>
                                        是
                                    </label>
                                </div>
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="is_index" value="0" @if($product->is_index == 0) checked @endif>
                                        否
                                    </label>
                                </div>
                            </th>
                        </tr>
                        <tr>
                            <th>是否上架:</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th>
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="is_up" value="1" @if($product->is_index == 1) checked @endif>
                                        是
                                    </label>
                                </div>
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="is_up" value="0" @if($product->is_index == 0) checked @endif>
                                        否
                                    </label>
                                </div>
                            </th>
                        </tr>
                        <tr>
                            <th>图片：</th>
                        </tr>
                        <tr class="newBorder_top">
                            <th>
                                <input id="input-id" type="file" class="file" data-preview-file-type="text" name="goods_img">
                            </th>
                        </tr>
                        </tbody>
                    </table>
                    <button type="submit" class="btn btn-default">提交</button>
                    <input type="hidden" name="product_id" value="{{ $product->product_id }}">
                    {{ Form::close() }}
                </div>
            </div>
        </div>
    </div>
@stop
